#include <iostream>
#include <string.h>
#include "sharecomm.h"
#include "Time.h"
#include "Fifo.h"
using namespace std;

int main()
{

    // key_t k = ftok(path.c_str(), projId);

    // cout << "k:" << k << endl;

    shm.Getshm();
    shm.Attach();
    // sleep(10);
    gpipe.OpenPipeForWrite();
    cout << "client attch done" << endl;
    struct data *image = (struct data *)shm.GetAdd();

    // printf("client 虚拟地址:%p\n", stringinfo);
    char c = 'A';
    while (c <= 'Z')
    {
        strcpy(image->status, "最新");
        strcpy(image->lasttime, GerCurrTime().c_str());
        strcpy(image->image, "xxxxxxxxxxx");
        gpipe.Signal();
        sleep(3);
    }
    shm.DetachShm();
    cout << "client detach done" << endl;
    return 0;
}